import React from 'react';
import styles from './index.less';
import { history, formatMessage, useIntl, getDvaApp } from 'umi';
import { Button } from 'antd';
const { ipcRenderer } = window.require('electron');
const Store = window.require('electron-store');
const store = new Store({});

store.set('name', '小明');
// store.delect('name')
export default function() {
  return (
    <div className="App container-fluid px-0">
      <Button
        onClick={() => {
          ipcRenderer.send('message', 'msg to main');
          console.log(store.get('name'));
        }}
      >
        发送消息了
      </Button>

      <Button
        onClick={() => {
          history.push('/asyncPage');
        }}
      >
        发送消息了
      </Button>
    </div>
  );
}
